package com.zr.model;
// Generated 2017-7-10 13:41:39 by Hibernate Tools 4.0.0.Final

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Creceipt generated by hbm2java
 */
@Entity
@Table(name = "creceipt", catalog = "cqlwlps", uniqueConstraints = @UniqueConstraint(columnNames = "seid"))
public class Creceipt implements java.io.Serializable {

	private Integer reid;
	private Cuser cuser;
	private Csealing csealing;
	private Ccarreport ccarreport;
	private Corder corder;
	private Cdriver cdriver;
	private String restartp;
	private String reendp;
	private String redate;
	private Set<Csealing> csealings = new HashSet<Csealing>(0);

	public Creceipt() {
	}

	public Creceipt(Ccarreport ccarreport, Cdriver cdriver, String restartp, String reendp) {
		this.ccarreport = ccarreport;
		this.cdriver = cdriver;
		this.restartp = restartp;
		this.reendp = reendp;
	}

	public Creceipt(Cuser cuser, Csealing csealing, Ccarreport ccarreport, Corder corder, Cdriver cdriver,
			String restartp, String reendp, String redate, Set<Csealing> csealings) {
		this.cuser = cuser;
		this.csealing = csealing;
		this.ccarreport = ccarreport;
		this.corder = corder;
		this.cdriver = cdriver;
		this.restartp = restartp;
		this.reendp = reendp;
		this.redate = redate;
		this.csealings = csealings;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "reid", unique = true, nullable = false)
	public Integer getReid() {
		return this.reid;
	}

	public void setReid(Integer reid) {
		this.reid = reid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "uid")
	public Cuser getCuser() {
		return this.cuser;
	}

	public void setCuser(Cuser cuser) {
		this.cuser = cuser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "seid", unique = true)
	public Csealing getCsealing() {
		return this.csealing;
	}

	public void setCsealing(Csealing csealing) {
		this.csealing = csealing;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "crid", nullable = false)
	public Ccarreport getCcarreport() {
		return this.ccarreport;
	}

	public void setCcarreport(Ccarreport ccarreport) {
		this.ccarreport = ccarreport;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "oid")
	public Corder getCorder() {
		return this.corder;
	}

	public void setCorder(Corder corder) {
		this.corder = corder;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "did", nullable = false)
	public Cdriver getCdriver() {
		return this.cdriver;
	}

	public void setCdriver(Cdriver cdriver) {
		this.cdriver = cdriver;
	}

	@Column(name = "restartp", nullable = false)
	public String getRestartp() {
		return this.restartp;
	}

	public void setRestartp(String restartp) {
		this.restartp = restartp;
	}

	@Column(name = "reendp", nullable = false)
	public String getReendp() {
		return this.reendp;
	}

	public void setReendp(String reendp) {
		this.reendp = reendp;
	}

	@Column(name = "redate")
	public String getRedate() {
		return this.redate;
	}

	public void setRedate(String redate) {
		this.redate = redate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "creceipt")
	public Set<Csealing> getCsealings() {
		return this.csealings;
	}

	public void setCsealings(Set<Csealing> csealings) {
		this.csealings = csealings;
	}

}
